<template>
    <div class="mime">
        <div class="Headtop">
            <router-link to="/settings">
                <i class="iconfont icon-settings setting"></i>
            </router-link>
        </div>
        <div class="block">
            <div class="touxiang" @click="goperson">
                <img :src="userData.img" alt="">
                <p class="name">{{userData.nick}}</p>
                <p class="info">{{userData.info}}</p>  
            </div>
            <ul>
                <li class="ul-item">消息通知</li>
            </ul>
        </div>
        <div class="block">
            <ul>
                <li class="ul-item">数据中心</li>
                <li class="ul-item">我的目标</li>
                <li class="ul-item">步数记录</li>
                <li class="ul-item">打卡记录</li>
            </ul>
        </div>
        <div class="block">
            <ul>
               <li class="ul-item">健身历史</li>
               <li class="ul-item">运动路线</li>
               <li class="ul-item">收藏</li>
               
            </ul>
        </div>
        <Nav/>
    </div>
</template>

<script>
import Nav from '../components/Nav/Nav'
export default {
    data() {
        return {
            userData:{}
        }
    },
    components:{
        Nav
    },
    methods: {
        goperson(){
            this.$router.push('/person')
        }
    },
    mounted() {
        this.api.GetUser()
        .then(res=>{
            console.log(res)
            if(res.data.success){
                this.userData=res.data.userData;
                
            }
        })
    },
}
</script>

<style lang="less" scoped>
.mime{
    width:100%;
    height: 100%;
    background: rgb(240,240,240)
}
.Headtop{
    width: 100%;
    height: 1rem;
    background: #333;
    position: relative;
    .setting{
        font-size:0.40rem;
        position: absolute;
        top: 0.2rem;
        right: 0.5rem;
        color: #999

    }
}
.block{
    margin-bottom: 0.2rem;
    background: #fff;
    
}
.touxiang{
    width: 100%;
    height: 2.5rem;
    background: rgb(254,217,6);
    padding:0.4rem 0.2rem;
    box-sizing: border-box;
    font-size: 0.40rem;
    img{
        width: 1.5rem;
        border-radius: 50%;
        float: left;
        margin-right: 0.2rem;
    }
    .name{
        font-size: 0.48rem;
        padding-top: 0.2rem;
        padding-bottom: 0.1rem;
    }
}
.ul-item{
    width: 100%;
    height: 1rem;
    line-height: 1rem;
    text-align: left;
    padding-left: 0.2rem;
    font-size: 0.32rem;
    box-sizing: border-box;
    border-bottom: 1px solid #ddd
}
</style>